<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link type="text/css" href="css/style.css" rel="stylesheet" />
<title>修改密码</title>
<script language="javascript" src="js/jquery-1.4.2.min.js"></script>
<script language="javascript" src="js/comm.js"></script>
<script language="javascript" src="js/manager.js"></script>
<script language="javascript" src="js/login_adduser.js"></script>
<style>
table {font-size:12px;border-collapse:collapse}
table td{border:1px solid #CCCCCC;height:30px;padding:5px}
</style>
  </head>
  <body>
<div class="mG_main">

        <!-- main -->
        <div class="mG_Title"> <span class="img"><img width="16" height="17" src="/images/ico/ico_t1.gif"></span>
          <div class="tits"><a href="list.php">帐户管理</a><em class="line">-&gt;</em><span class="fb">修改密码</span></div>
          <div class="clearit"></div>
        </div>

        <div class="mG_module">
          <div class="user_list">
		<div class="user_list">
        <form name="upform" action="user_passwd_action.php" method="post">
        {if $user.staff}<input type="hidden" name="action" value="update" />{/if}
        <table cellspacing="0" cellpadding="0" >
        <tr><td>原密码</td><td><input type="password" name="password"  id="password" /></td></tr>
        <tr><td>新密码</td><td><input type="password" name="password1"  id="password1" /> <span style="color:red">* (请输入6-14位非纯数字)</span></td></tr>
        <tr><td>确认密码</td><td><input type="password" name="password2"  id="password2" /></td></tr>
        </table>
            <div style="margin-top:10px">
            <a href="javascript:void(0);" id="user_passwd" class="btn_green_s"><em>更 新</em></a>
            <a onclick="window.history.back()" href="javascript:void(0);" class="btn_green_s"><em>取 消</em></a>
            </div>
        </form>
	</div>
    </div>
        </div>
        <!-- /main-->
        <div class="clearit"></div>
	  </div>
  </body>

<script type="text/javascript">
    {literal}
    $(function() {
        $("#user_passwd").click(function() {
            var passwd1 = $("#password1").val();
            var passwd2 = $("#password2").val();
            if(passwd1.length < 6 || passwd1.length > 14) {
                alert('密码长度6-14位');return false;
            }
            if(passwd1!=passwd2) {
                alert('新旧密码不同');return false;
            }

            //检查密码
            var pattern = /^[0-9a-zA-Z]+$/i;
            if (pattern.test(passwd1)) {
                var stri = /[A-Za-z]/;
                var i = /[0-9]+/;
                var spec=/[,.<>{}~!@#$%^&*]/;
                
                if(!stri.test(passwd1)){
                    alert("必须包含字母");
			        return false;
                }
                if(!i.test(passwd1)){
                    alert("必须包含数字");
				    return false;
                }
            }
            else {
                alert("密码只能包含字母、数字");
                return false;
            }

            document.forms.upform.submit();
        });
    });

    {/literal}
</script>
</html>